import { Action } from "@ngrx/store";
import {
  ISelectSymbolResponse,
  ISelectSymbolRequest,
  ISelectOrderResponse,
  ISelectOrderRequest,
  IAddOrderRequest,
  IAddOrderResponse,
  IDelOrderRequest,
  IDelOrderResponse,
  ISelectCoinListsRequest,
  ISelectCoinListsResponse
} from "../models/main";
export enum MainActionTypes {
  SelectSymbol = "[Main] SelectSymbol",
  SelectSymbolSuccess = "[Main] Select Symbol Success",
  SelectSymbolError = "[Main] Select Symbol Error",

  AddOrder = "[Main] Add Order",
  AddOrderSuccess = "[Main] Add Order Success",
  AddOrderError = "[Main] Add Order Error",

  SelectOrder = "[Main] Select Order",
  SelectOrderSuccess = "[Main] Select Order Success",
  SelectOrderError = "[Main] Select Order Error",

  DelOrder = "[Main] Del Order",
  DelOrderSuccess = "[Main] Del Order Success",
  DelOrderError = "[Main] Del Order Error",

  // here is repeat with selectAssets need to remove it
  SelectCoinLists = "[Main] SelectCoinLists",
  SelectCoinListsSuccess = "[Main] Del SelectCoinLists Success",
  SelectCoinListsError = "[Main] Del SelectCoinLists Error"
}

export class SelectSymbol implements Action {
  readonly type = MainActionTypes.SelectSymbol;
  constructor(public payload: { req: ISelectSymbolRequest }) {}
}

export class SelectSymbolSuccess implements Action {
  readonly type = MainActionTypes.SelectSymbolSuccess;
  constructor(public payload: { res: ISelectSymbolResponse }) {}
}

export class SelectSymbolError implements Action {
  readonly type = MainActionTypes.SelectSymbolError;
  constructor(public payload: { error: any }) {}
}

export type MainActionsUnion =
  | SelectSymbol
  | SelectSymbolSuccess
  | SelectSymbolError;
